﻿using System.Windows.Controls;
using Microsoft.Phone.Controls;

namespace dIRca.WP7.Views
{
    /// <summary>
    /// Description for ConnectionsView.
    /// </summary>
    public partial class ConnectionsView : PhoneApplicationPage
    {
        /// <summary>
        /// Initializes a new instance of the ConnectionsView class.
        /// </summary>
        public ConnectionsView()
        {
            InitializeComponent();
        }

        private void ItemsSelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
        {
            if ((sender != null) && (e.AddedItems.Count != 0))
            {
                var control = ((ListBox)sender);
                UpdateLayout();
                control.ScrollIntoView(control.SelectedItem);
            }
        }
    }
}